Hands-On Spring Security 5 for Reactive Applications: Learn effective ways to secure your applications with Spring and Spring WebFlux by Tomcy John
Author:Tomcy John [John, Tomcy]
Language: eng
Format: epub
Tags: COM005000 - COMPUTERS / Enterprise Applications / General, COM051280 - COMPUTERS / Programming Languages / Java, COM053000 - COMPUTERS / Security / General
Publisher: Packt Publishing
Published: 2018-07-30T23:00:00+00:00
<build>
<plugins>
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>9.4.10.v20180503</version>
</plugin>
</plugins>
</build>
We add Spring Framework, Spring Security, JSP/JSTL, and the logging framework (SLF4J and Logback) dependencies. We will be using an embedded jetty server (look at the build section) to run our application.
Setting up LoginModule
LoginModule is responsible for authenticating a user. We will be creating our own LoginModule named JaasLoginModule and then implementing the login method. Being a sample application, our login logic is quite trivial. The LoginModule interface has to be implemented for you to write your own custom login module.
Create a class, JaasLoginModule.java (which implements LoginModule), and implement all the methods. In this class, we will be focusing on two important methods. In the initialize method, we get all the necessary information, such as username/password/subject, that is stored as field variables to be used in our main login method:
// Gather information and then use this in the login method
@Override
public void initialize(Subject subject, CallbackHandler callbackHandler, Map<String,
?> sharedState, Map<String, ?> options) {
this.subject = subject;
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
The Mikado Method by Ola Ellnestam Daniel Brolund(27119)
Hello! Python by Anthony Briggs(25972)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(25311)
Kotlin in Action by Dmitry Jemerov(24417)
The Well-Grounded Java Developer by Benjamin J. Evans Martijn Verburg(23613)
Dependency Injection in .NET by Mark Seemann(23329)
OCA Java SE 8 Programmer I Certification Guide by Mala Gupta(21963)
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(20867)
Grails in Action by Glen Smith Peter Ledbrook(19886)
Adobe Camera Raw For Digital Photographers Only by Rob Sheppard(17081)
Sass and Compass in Action by Wynn Netherland Nathan Weizenbaum Chris Eppstein Brandon Mathis(16849)
Secrets of the JavaScript Ninja by John Resig & Bear Bibeault(14477)
Test-Driven iOS Development with Swift 4 by Dominik Hauser(12596)
Jquery UI in Action : Master the concepts Of Jquery UI: A Step By Step Approach by ANMOL GOYAL(11876)
A Developer's Guide to Building Resilient Cloud Applications with Azure by Hamida Rebai Trabelsi(10657)
Hit Refresh by Satya Nadella(9254)
The Kubernetes Operator Framework Book by Michael Dame(8598)
Exploring Deepfakes by Bryan Lyon and Matt Tora(8449)
Robo-Advisor with Python by Aki Ranin(8394)